<template>
  <el-dialog :title="title" :close-on-click-modal="false" :fullscreen="true" :visible.sync="visible"
    :before-close="cancel" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="50%">
    <el-row class="JNPF-common-search-box" :gutter="16">
      <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
       
          <el-col :span="8">
            <el-form-item label="机构名称">
              <el-select v-model="dataForm.FSCHOOL" placeholder="请选择">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

        <el-col :span="8">
            <el-form-item label="基地名称">
              <el-select v-model="dataForm.FPOINT" placeholder="请选择">
                <el-option
                  v-for="item in options4"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

        <el-col :span="8">
            <el-form-item label="课程状态">
              <el-select v-model="dataForm.FBILLSTATE" placeholder="请选择">
                <el-option
                  v-for="item in options3"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

        <el-col :span="8">
          <el-form-item label="课程编号" prop="FCATNO">
            <el-input v-model="dataForm.FCATNO"   />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="课程名称" prop="FCATNAME">
            <el-input v-model="dataForm.FCATNAME"   />
          </el-form-item>
        </el-col>

        <!-- <el-col :span="8">
          <el-form-item label="计划人数" prop="FNUM">
            <el-input v-model="dataForm.FNUM"   />
          </el-form-item>
        </el-col> -->

        <el-col :span="8">
          <el-form-item label="人均费用" prop="FMONEY">
            <el-input v-model="dataForm.FMONEY"   />
          </el-form-item>
        </el-col>

        
        <el-col :span="16">
          <el-form-item label="研学主题" prop="FMEMO">
            <el-input v-model="dataForm.FMEMO"   />
          </el-form-item>
        </el-col>

        <el-col :span="16">
          <el-form-item label="课程链接" prop="FURL">
            <el-input v-model="dataForm.FURL"   />
          </el-form-item>
        </el-col>
        
        <el-col :span="5">
          <el-form-item label="">
            <!-- <el-button type="success" icon="el-icon-plus" @click="insert">添加场地</el-button> -->
            <el-button type="primary" :loading="loading" @click="closePage">返回</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>

    <template>
     <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane label="行程安排" name="first">
       
        <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
        <el-col :span="24">
          <el-input
              type="textarea"
              :rows="5"
              placeholder="请输入内容"
              v-model="textarea1">
            </el-input>
        </el-col>

      </el-form>

      </el-tab-pane>

      <el-tab-pane label="研学导师" name="second">
        <el-table :data="list1" border stripe>
          <!-- <el-table-column label="操作" width="80">
            <template slot-scope="scope">
              <el-button slot="reference" icon="el-icon-delete" style="color: red" @click="shopdate(scope.$index)"
                type="text">删除</el-button>
            </template>
          </el-table-column> -->
          <el-table-column prop="FENTRYID"FDATE label="序号" width="85" ></el-table-column>
          <el-table-column prop="FCATNAME" label="导师姓名"  ></el-table-column>
          <el-table-column prop="FNOTE" label="导师说明"  ></el-table-column>
          <el-table-column prop="FMEMO" label="备注"></el-table-column>
       </el-table>
        <!-- <div class="addbox">
             <el-link icon="el-icon-plus" type="primary" >添加一行</el-link>
        </div> -->
      </el-tab-pane>

      <el-tab-pane label="住宿安排" name="three">
        <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
        <el-col :span="24">
          <el-input
              type="textarea"
              :rows="5"
              placeholder="请输入内容"
              v-model="textarea1">
            </el-input>
        </el-col>

      </el-form>
      </el-tab-pane>
      
      <el-tab-pane label="餐饮安排" name="four">
        <el-table :data="list3" border stripe>
          <!-- <el-table-column label="操作" width="80">
            <template slot-scope="scope">
              <el-button slot="reference" icon="el-icon-delete" style="color: red" @click="shopdate(scope.$index)"
                type="text">删除</el-button>
            </template>
          </el-table-column> -->
          <el-table-column prop="FENTRYID"FDATE label="序号" width="85" ></el-table-column>
          <el-table-column prop="FDATE" label="日期""  ></el-table-column>
          <el-table-column prop="FTYPE" label="餐别"   ></el-table-column>
          <el-table-column prop="FPRICE" label="餐标"   ></el-table-column>
          <el-table-column prop="FNOTE" label="说明"   ></el-table-column>
          <el-table-column prop="FMEMO" label="备注"></el-table-column>
       </el-table>
        <!-- <div class="addbox">
             <el-link icon="el-icon-plus" type="primary" >添加一行</el-link>
        </div> -->
      </el-tab-pane>
   
      <el-tab-pane label="交通安排" name="five">
        <el-table :data="list4" border stripe>
          <!-- <el-table-column label="操作" width="80">
            <template slot-scope="scope">
              <el-button slot="reference" icon="el-icon-delete" style="color: red" @click="shopdate(scope.$index)"
                type="text">删除</el-button>
            </template>
          </el-table-column> -->
          <el-table-column prop="FENTRYID"FDATE label="序号" width="85" ></el-table-column>
          <el-table-column prop="FDATE" label="日期"  width="125" ></el-table-column>
          <el-table-column prop="FTYPE" label="交通方式"  ></el-table-column>
          <el-table-column prop="FCATNAME" label="交通说明"  ></el-table-column>
          <el-table-column prop="FMEMO" label="备注"></el-table-column>
       </el-table>
        <!-- <div class="addbox">
             <el-link icon="el-icon-plus" type="primary" >添加一行</el-link>
        </div> -->
      </el-tab-pane>

      <el-tab-pane label="人身保险" name="six">
        <el-table :data="list5" border stripe>
          <!-- <el-table-column label="操作" width="80">
            <template slot-scope="scope">
              <el-button slot="reference" icon="el-icon-delete" style="color: red" @click="shopdate(scope.$index)"
                type="text">删除</el-button>
            </template>
          </el-table-column> -->
          <el-table-column prop="FENTRYID"FDATE label="序号" width="85" ></el-table-column>
          <el-table-column prop="FTYPE" label="保险类型"  width="125" ></el-table-column>
          <el-table-column prop="FCATNAME" label="保险说明"  ></el-table-column>
          <el-table-column prop="FMEMO" label="备注"></el-table-column>
       </el-table>
        <!-- <div class="addbox">
             <el-link icon="el-icon-plus" type="primary" >添加一行</el-link>
        </div> -->
      </el-tab-pane>

      <el-tab-pane label="课程标签" name="seven">
        <el-table :data="list6" border stripe>
          <!-- <el-table-column label="操作" width="80">
            <template slot-scope="scope">
              <el-button slot="reference" icon="el-icon-delete" style="color: red" @click="shopdate(scope.$index)"
                type="text">删除</el-button>
            </template>
          </el-table-column> -->
          <el-table-column prop="FENTRYID"FDATE label="序号" width="85" ></el-table-column>
          <el-table-column prop="FTYPE" label="标签分类"  ></el-table-column>
          <el-table-column prop="FCATNAME" label="标签名称" ></el-table-column>
          <el-table-column prop="FMEMO" label="备注"></el-table-column>
       </el-table>
        <!-- <div class="addbox">
             <el-link icon="el-icon-plus" type="primary" >添加一行</el-link>
        </div> -->
      </el-tab-pane>

      <el-tab-pane label="研学装备" name="eight">
        <el-table :data="list7" border stripe>
          <!-- <el-table-column label="操作" width="80">
            <template slot-scope="scope">
              <el-button slot="reference" icon="el-icon-delete" style="color: red" @click="shopdate(scope.$index)"
                type="text">删除</el-button>
            </template>
          </el-table-column> -->
          <el-table-column prop="FENTRYID"FDATE label="序号" width="85" ></el-table-column>
          <el-table-column prop="FTYPE" label="装备名称"   ></el-table-column>
          <el-table-column prop="FCATNAME" label="装备说明"  ></el-table-column>
          <el-table-column prop="FMEMO" label="备注"></el-table-column>
       </el-table>
        <!-- <div class="addbox">
             <el-link icon="el-icon-plus" type="primary" >添加一行</el-link>
        </div> -->
      </el-tab-pane>

    </el-tabs>
    
   </template>

    <StudqueryFcuston ref="StudqueryFcuston" @confirm="shoplist" />
  </el-dialog>
</template>
<script>
  import StudqueryFcuston from "@/components/StudqueryFcuston/StudqueryFcuston.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    components: { StudqueryFcuston },
    props: {
      formationlist: {
        type: Array,
        default: [],
      },
    },
    data() {
      return {
        activeName: 'first',

        textarea1:"学校包车",
        textarea2:"当天来回,没有住宿",
        textarea3:"午餐在好福气大饭店",

        title: "新增",
        insertorupdate: true,
        dataForm: {
            FBILLNO: "Y241130002", 
            FBILLCREDATE:"2024-12-13",
            FUSER: "汉武帝",
            FSCHOOL: "‌上海研学教育中心",
            FCATNO:"SH240101",
            FCATNAME: "上海博物馆研学",
            FPOINT:"上海博物馆",
            FBEGDATE: "2025-03-15",
            FENDDATE:"2025-03-17",
            FCLASS:"初一",
            FNUM:250,
            FMONEY:500,
            FMEMO: "培养孩子对传统文化的喜爱",
            FCHECKUSE: "",
            FCHECKDATE: "",
            FNOTE:"",
            FURL:"https://www.youxue.com.cn/xinxi/html/2024/11/1614.htm",
            FBILLTYPE:"新课程",
            FBILLSTATE: "正常"
        },
        rules: {
          FUSERNUMBER:[
            { required: true, message: '请输入学籍号码', trigger: 'blur' },
          ],
          FUSER: [
            { required: true, message: '请输入申请人员', trigger: 'blur' },
          ],
          FMEMO: [
            { required: true, message: '请输入申请理由', trigger: 'blur' },
          ],
        },
        list1: [{  "FENTRYID":1,
                  "FCATNAME": "张骞",
                  "FNOTE":"精通人文",
                  "FMEMO": ""
                },
                { "FENTRYID":2,
                  "FCATNAME": "徐霞客",
                  "FNOTE":"精通地理",
                  "FMEMO": ""
                }],
        list2: [{  "FENTRYID":1,
                    "FDATE": "3-15",
                    "FTIME": "08:00",
                    "FWORKNAME": "学校大门口集合",
                    "FMEMO": ""
                  },
                  { "FENTRYID":2,
                    "FDATE": "3-15",
                    "FTIME": "08:30",
                    "FWORKNAME": "班车出发",
                    "FMEMO": ""
                  },
                  { "FENTRYID":3,
                    "FDATE": "3-15",
                    "FTIME": "10:30",
                    "FWORKNAME": "达到上海国际汽车城",
                    "FMEMO": ""
                  }],
        list3: [{ "FENTRYID":1,
                  "FDATE":"第一天",
                  "FTYPE": "午餐",
                  "FPRICE": "20",
                  "FNOTE":"菜品清单",
                  "FMEMO": ""
                },
                { "FENTRYID":2,
                  "FDATE":"第一天",
                  "FTYPE": "晚餐",
                  "FPRICE": "20",
                  "FNOTE":"菜品清单",
                  "FMEMO": ""
                },
                { "FENTRYID":3,
                  "FDATE":"第二天",
                  "FTYPE": "早餐",
                  "FPRICE": "10",
                  "FNOTE":"菜品清单",
                  "FMEMO": ""
                },
                { "FENTRYID":4,
                  "FDATE":"第二天",
                  "FTYPE": "午餐",
                  "FPRICE": "20",
                  "FNOTE":"菜品清单",
                  "FMEMO": ""
                }],
          list4: [{ "FENTRYID":1,
                  "FDATE":"第一天",
                  "FTYPE": "大巴",
                  "FCATNAME": "",
                  "FMEMO": ""
                },
                { "FENTRYID":2,
                  "FDATE":"第一天",
                  "FTYPE": "大巴",
                  "FCATNAME": "每次事故责任限额6,000,000",
                  "FMEMO": ""
                },
                { "FENTRYID":3,
                  "FDATE":"第一天",
                  "FTYPE": "大巴",
                  "FCATNAME": "每次事故责任限额6,000,000",
                  "FMEMO": ""
                },
                { "FENTRYID":4,
                  "FDATE":"第二天",
                  "FTYPE": "大巴",
                  "FCATNAME": "每次事故责任限额6,000,000",
                  "FMEMO": ""
                }],
          list5: [{ "FENTRYID":1,
                    "FTYPE": "旅游人身意外险",
                    "FCATNAME": "意外：100,000",
                    "FMEMO": ""
                },
                { "FENTRYID":2,
                  "FTYPE": "旅行社责任险",
                  "FCATNAME": "每次事故责任限额6,000,000",
                  "FMEMO": ""
                }],
          list6: [{  "FENTRYID":1,
                    "FTYPE": "课程类型",
                    "FCATNAME": "传统文化",
                    "FMEMO": ""
                  },
                  { "FENTRYID":2,
                    "FTYPE": "适应学段",
                    "FCATNAME": "初中",
                    "FMEMO": ""
                  },
                  { "FENTRYID":3,
                    "FTYPE": "出行天数",
                    "FCATNAME": "2天1晚",
                    "FMEMO": ""
                  }],
          list7: [{  "FENTRYID":1,
                    "FTYPE": "智能手环",
                    "FCATNAME": "实时监控人体",
                    "FMEMO": ""
                  },
                  { "FENTRYID":2,
                    "FTYPE": "智能视频",
                    "FCATNAME": "实时视频监控",
                    "FMEMO": ""
                  },
                  { "FENTRYID":3,
                    "FTYPE": "穿戴",
                    "FCATNAME": "背包&帽子",
                    "FMEMO": ""
                  }],
        loading: false,
        visible: false,

        //所属校区选择数据
        options1: [{
          value: 'L001',
          label: '蓝湖营地教育冬令营'
        }, {
          value: 'L002',
          label: '上海研学教育中心'
        }, {
          value: 'L003',
          label: '上海科技研学基地'
        }, {
          value: 'L004',
          label: '上海文化之旅研学机构'
        }],


        options3: [{
          value: '1',
          label: '正常'
        }, {
          value: '2',
          label: '停止'
        }],

        //所属校区选择数据
        options2: [{
          value: '1',
          label: '新课程'
        }, {
          value: '2',
          label: '改课程'
        }, {
          value: '3',
          label: '老课程'
        }],
        
      };
    },
    created() {
    },
    mounted() { },
    methods: {
      closePage(){
        console.log('关闭弹窗dialog');
        this.visible = false;
      },
      init(FBILLNO) {
        this.dataForm.FBILLNO = FBILLNO;
        if (this.dataForm.FBILLNO) {
          this.title = "修改"
          this.insertorupdate = false;
        }
        else {
          this.title = "新增"
          this.dataForm.FBILLNO = "K" + Math.floor(Math.random() * 10000000) + 1;
          this.insertorupdate = true;
        }
        this.visible = true;
      },
      insert() {
        this.$refs.StudqueryFcuston.open();
      },
      shoplist(data) {
        data.forEach(item => {
          this.list.push({
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "1"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "曹操"
          },{
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "2"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "刘备"
          })
        });
      },
      //
      cancel() {
        this.$refs.elForm.resetFields();
        this.list = [];
        this.visible = false;
      },
    },
  };
</script>